package mapper;

import bean.Student;
import org.apache.ibatis.annotations.*;
import sql.ReturnSql;

import java.util.List;

public interface StudentMapper {
    //查询全部
//    @Select("SELECT * FROM student")
    @SelectProvider( type = ReturnSql.class,method = "getSelectAll")
    public abstract List<Student> selectAll();


    //新增操作
//    @Insert("INSERT INTO student VALUES (#{sid},#{name},#{age},#{birthday})")
    @InsertProvider(type = ReturnSql.class,method = "getInsert")
    public abstract Integer insert(Student stu);

    //修改操作
//    @Update("UPDATE student SET name=#{name},age=#{age},birthday=#{birthday} WHERE sid=#{sid}")
    @UpdateProvider(type = ReturnSql.class,method = "getUpdate")
    public abstract Integer update(Student stu);

    //删除操作
//    @Delete("DELETE FROM student WHERE sid=#{sid}")
    @DeleteProvider(type = ReturnSql.class,method = "getDelete")
    public abstract Integer delete(Integer sid);
}
